home *** CD-ROM | disk | FTP | other *** search
/ Hardcore Visual Basic 5.0 (2nd Edition) / Hardcore Visual Basic 5.0 - Second Edition (1997)(Microsoft Press).iso / Code / declare.bas < prev    next >
BASIC Source File  |  1997-06-14  |  4KB  |  123 lines

  1. Attribute VB_Name = "MDeclare"
  2. Option Explicit
  3. ' Here's another comment
  4.  
  5. ' These are types and declares described in the book (especially Chapter 2).
  6. ' They are in a false conditionals so that the ones in the Windows API type
  7. ' library will override them. You can enable these versions to confirm that
  8. ' the Declare statements and type library entries are equivalent.
  9. #If fUseDeclares Then
  10.  
  11. Type LARGE_INTEGER
  12.     LowPart As Long
  13.     HighPart As Long
  14. End Type
  15.  
  16. Type BITMAP
  17.     bmType As Long
  18.     bmWidth As Long
  19.     bmHeight As Long
  20.     bmWidthBytes As Long
  21.     bmPlanes As Integer
  22.     bmBitsPixel As Integer
  23.     bmBits As Long
  24. End Type
  25.  
  26. Type POINTL
  27.     x As Long
  28.     y As Long
  29. End Type
  30.  
  31. Type WINDOWPLACEMENT
  32.     length As Long
  33.     Flags As Long
  34.     showCmd As Long
  35.     ptMinPosition As POINTL
  36.     ptMaxPosition As POINTL
  37.     rcNormalPosition As RECT
  38. End Type
  39.  
  40. Declare Function Polygon Lib "GDI32" (ByVal hDC As Long, _
  41.     lpPoints As POINTL, ByVal nCount As Long) As Long
  42.  
  43. Declare Function SetWindowPlacement Lib "USER32" ( _
  44.     ByVal hWnd As Long, lpwndpl As WINDOWPLACEMENT) As Long
  45. Declare Function GetWindowPlacement Lib "USER32" ( _
  46.     ByVal hWnd As Long, lpwndpl As WINDOWPLACEMENT) As Long
  47.  
  48. Public Declare Sub CopyMemory Lib "KERNEL32" Alias "RtlMoveMemory" ( _
  49.     lpvDest As Any, lpvSource As Any, ByVal cbCopy As Long)
  50.  
  51. Declare Function GetScrollRange Lib "USER32" (ByVal hWnd As Long, _
  52.     ByVal nBar As Long, lpMin As Long, lpMax As Long) As Long
  53.  
  54. #If 0 Then
  55. Declare Function FindWindow Lib "USER32" Alias "FindWindowA" ( _
  56.     ByVal lpszClassName As String, ByVal lpszWindow As String) As Long
  57. #Else
  58. Declare Function FindWindow Lib "USER32" Alias "FindWindowA" ( _
  59.     Optional ByVal Class As String, _
  60.     Optional ByVal Title As String) As Long
  61. #End If
  62.  
  63. Declare Function WindowFromPointXY Lib "USER32" _
  64.     Alias "WindowFromPoint" (ByVal xPoint As Long, _
  65.     ByVal yPoint As Long) As Long
  66. Declare Function ChildWindowFromPointXY Lib "USER32" _
  67.     Alias "WindowFromPoint" (ByVal hWnd As Long, _
  68.     ByVal xPoint As Long, ByVal yPoint As Long) As Long
  69. Declare Function WindowFromPoint Lib "USER32" _
  70.     (ByVal xPoint As Long, ByVal yPoint As Long) As Long
  71. Declare Function VBGetObject Lib "GDI32" Alias "GetObjectA" ( _
  72.     ByVal hObject As Long, ByVal cbBuffer As Long, _
  73.     lpvObject As Any) As Long
  74.  
  75. Declare Function GetObjectBrush Lib "GDI32" Alias "GetObjectA" ( _
  76.     ByVal hBrush As Long, ByVal cbBuffer As Long, _
  77.     lpBrush As LOGBRUSH) As Long
  78.  Declare Function GetObjectBitmap Lib "GDI32" Alias "GetObjectA" ( _
  79.     ByVal hBitmap As Long, ByVal cbBuffer As Long, _
  80.     lpBitmap As BITMAP) As Long
  81.  
  82. Declare Function SendMessageVal Lib "USER32" Alias "SendMessageA" ( _
  83.     ByVal hWnd As Long, ByVal wMsg As Long, _
  84.     ByVal wParam As Long, ByVal lParam As Any) As Long
  85. Declare Function SendMessageStr Lib "USER32" Alias "SendMessageA" ( _
  86.     ByVal hWnd As Long, ByVal wMsg As Long, _
  87.     ByVal wParam As Long, ByVal lParam As String) As Long
  88. Declare Function SendMessage Lib "USER32" Alias "SendMessageA" ( _
  89.     ByVal hWnd As Long, ByVal wMsg As Long, _
  90.     wParam As Any, lParam As Any) As Long
  91.  
  92. Declare Function GetWindowText Lib "USER32" Alias "GetWindowTextA" ( _
  93.     ByVal hWnd As Long, ByVal lpString As String, _
  94.     ByVal nMaxCount As Long) As Long
  95.  
  96. Declare Function GetWindowRect Lib "USER32" (ByVal hWnd As Long, _
  97.     lprc As RECT) As Long
  98. Declare Sub ClientToScreen Lib "USER32" (ByVal hWnd As Long, _
  99.     lpPoint As POINTL)
  100.  
  101. Declare Function FloodFill Lib "GDI32" (ByVal hDC As Long, _
  102.     ByVal nXStart As Long, ByVal nYStart As Long, _
  103.     ByVal crFill As Long) As Long
  104.     
  105. Public Declare Function EnumWindows Lib "USER32" ( _
  106.     ByVal lpEnumFunc As Long, lParam As Any) As Long
  107.  
  108. Private Declare Function SearchPath Lib "kernel32.dll" ( _
  109.     ByVal lpPath As String, ByVal lpFileName As String, _
  110.     ByVal lpExtension As String, ByVal nBufferLenght As Long, _
  111.     ByVal lpBuffer As String, lpFilePart As Long) As Long
  112.  
  113. Declare Function QueryPerformanceCounter Lib "KERNEL32" ( _
  114.     lpPerformanceCount As Currency) As Long
  115.  
  116. Declare Function QueryPerformanceFrequency Lib "KERNEL32" ( _
  117.     lpFrequency As Currency) As Long
  118.     
  119. #End If
  120.  
  121.  
  122.  
  123.